dynActorArray = {}

function onCreate()

    ------------------
    Ground_ = luajava.new(Ground)
    Ground_:addVertex(19.0, 18.0)
    Ground_:addVertex(779.0, 18.0)
    Ground_:addVertex(779.0, 59.999996)
    Ground_:addVertex(19.0, 59.999996)
    Ground_:setRotation(0.0)
    Ground_:setName('Ground_')
    world:add(Ground_)

    ------------------
    Ground_0 = luajava.new(Ground)
    Ground_0:addVertex(299.0, 331.0)
    Ground_0:addVertex(259.0, 339.0)
    Ground_0:addVertex(244.0, 327.0)
    Ground_0:addVertex(239.00002, 307.0)
    Ground_0:addVertex(254.0, 291.99997)
    Ground_0:addVertex(286.0, 289.0)
    Ground_0:addVertex(304.0, 304.0)
    Ground_0:addVertex(304.0, 311.0)
    Ground_0:addToPosition(65.0, -100.0)
    Ground_0:setRotation(0.0)
    Ground_0:setName('Ground_0')
    Ground_0:setVisible(true)
    --world:add(Ground_0)

    ball_7 = luajava.new(Ball)
    ball_7:setPosition(350, 240)
    ball_7:setRotation(0.0)
    ball_7:setName('ball_7')
    ball_7:setVisible(true)
    ball_7:setBodyType(STATIC_BODY)
    world:add(ball_7)

    ------------------
    Ground_1 = luajava.new(Ground)
    Ground_1:addVertex(34.0, 359.0)
    Ground_1:addVertex(32.0, 334.0)
    Ground_1:addVertex(77.0, 349.0)
    Ground_1:addToPosition(-41.0, -110.0)
    Ground_1:setRotation(0.0)
    Ground_1:setName('Ground_1')
    Ground_1:setVisible(true)
    world:add(Ground_1)

    Ground_1 = luajava.new(Ground)
    Ground_1:addVertex(34.0, 359.0)
    Ground_1:addVertex(32.0, 334.0)
    Ground_1:addVertex(77.0, 349.0)
    Ground_1:addToPosition(-41.0, -180.0)
    Ground_1:setRotation(0.0)
    Ground_1:setName('Ground_1')
    Ground_1:setVisible(true)
    world:add(Ground_1)

    ------------------
    Ground_2 = luajava.new(Ground)
    Ground_2:addVertex(91.0, 349.0)
    Ground_2:addVertex(120.99999, 329.0)
    Ground_2:addVertex(145.99998, 312.0)
    Ground_2:addVertex(165.99998, 284.0)
    Ground_2:addVertex(216.00002, 284.0)
    Ground_2:addVertex(259.0, 299.0)
    Ground_2:addVertex(279.0, 327.0)
    Ground_2:addVertex(297.0, 334.0)
    Ground_2:addVertex(314.0, 312.0)
    Ground_2:addVertex(331.0, 284.0)
    Ground_2:addVertex(370.99997, 277.0)
    Ground_2:addVertex(404.0, 291.0)
    Ground_2:addVertex(416.0, 309.0)
    Ground_2:addVertex(429.0, 324.0)
    Ground_2:addVertex(441.0, 334.0)
    Ground_2:addVertex(458.99997, 302.0)
    Ground_2:addVertex(489.0, 253.99997)
    Ground_2:addVertex(529.0, 247.0)
    Ground_2:addVertex(576.0, 253.99997)
    Ground_2:addVertex(614.0, 284.0)
    Ground_2:addVertex(644.0, 326.0)
    Ground_2:addVertex(651.0, 356.0)
    Ground_2:addVertex(624.0, 322.0)
    Ground_2:addVertex(594.0, 299.0)
    Ground_2:addVertex(554.0, 279.0)
    Ground_2:addVertex(506.99997, 286.0)
    Ground_2:addVertex(481.99997, 306.0)
    Ground_2:addVertex(462.0, 346.0)
    Ground_2:addVertex(439.0, 374.0)
    Ground_2:addVertex(402.0, 391.99997)
    Ground_2:addVertex(368.99997, 393.99997)
    Ground_2:addVertex(364.0, 377.0)
    Ground_2:addVertex(391.0, 366.99997)
    Ground_2:addVertex(414.0, 349.0)
    Ground_2:addVertex(408.99997, 327.0)
    Ground_2:addVertex(379.0, 293.99997)
    Ground_2:addVertex(341.99997, 301.0)
    Ground_2:addVertex(327.0, 318.99997)
    Ground_2:addVertex(318.99997, 346.0)
    Ground_2:addVertex(324.0, 366.0)
    Ground_2:addVertex(361.0, 376.0)
    Ground_2:addVertex(364.0, 393.99997)
    Ground_2:addVertex(307.0, 384.0)
    Ground_2:addVertex(257.0, 391.99997)
    Ground_2:addVertex(207.0, 395.99997)
    Ground_2:addVertex(159.00002, 395.99997)
    Ground_2:addVertex(116.99999, 372.0)
    Ground_2:addVertex(111.0, 359.0)
    Ground_2:addVertex(91.99999, 356.0)
    Ground_2:addVertex(104.0, 352.0)
    Ground_2:addVertex(116.0, 354.0)
    Ground_2:addVertex(131.0, 366.0)
    Ground_2:addVertex(154.0, 374.0)
    Ground_2:addVertex(199.0, 379.0)
    Ground_2:addVertex(244.0, 370.99997)
    Ground_2:addVertex(274.0, 366.0)
    Ground_2:addVertex(264.0, 339.0)
    Ground_2:addVertex(241.99998, 314.0)
    Ground_2:addVertex(202.0, 304.0)
    Ground_2:addVertex(144.0, 324.0)
    Ground_2:addVertex(116.0, 343.99997)
    Ground_2:addVertex(114.0, 349.0)
    Ground_2:addToPosition(-26.999994, -131.0)
    Ground_2:setRotation(0.0)
    Ground_2:setName('Ground_2')
    Ground_2:setBodyType(DYNAMIC_BODY)
    Ground_2:setFriction(0.5)
    world:add(Ground_2)

    ------------------
    trigger_3 = luajava.new(Trigger)
    trigger_3:setPosition(727.57153, 126.48703)
    trigger_3:setRotation(359.9033)
    trigger_3:setName('trigger_3')
    trigger_3:setVisible(true)
    world:add(trigger_3)

    ------------------
    Ground_4 = luajava.new(Ground)
    Ground_4:addVertex(639.0, 58.999996)
    Ground_4:addVertex(658.99994, 61.0)
    Ground_4:addVertex(660.99994, 91.0)
    Ground_4:addVertex(666.0, 111.0)
    Ground_4:addVertex(669.0, 125.999985)
    Ground_4:addVertex(691.0, 133.99998)
    Ground_4:addVertex(706.0, 133.99998)
    Ground_4:addVertex(726.0, 133.99998)
    Ground_4:addVertex(739.0, 118.99999)
    Ground_4:addVertex(744.0, 98.99999)
    Ground_4:addVertex(739.0, 74.0)
    Ground_4:addVertex(741.99994, 53.999996)
    Ground_4:addVertex(774.0, 57.0)
    Ground_4:addVertex(766.99994, 118.99999)
    Ground_4:addVertex(752.0, 145.99998)
    Ground_4:addVertex(708.99994, 151.0)
    Ground_4:addVertex(667.0, 144.0)
    Ground_4:addVertex(647.0, 102.0)
    Ground_4:addToPosition(-7.0, 2.0)
    Ground_4:setRotation(0.0)
    Ground_4:setName('Ground_4')
    Ground_4:setVisible(true)
    world:add(Ground_4)

    ------------------
    ball_5 = luajava.new(Ball)
    ball_5:setPosition(245.0, 244.99997)
    ball_5:setRotation(0.0)
    ball_5:setName('ball_5')
    ball_5:setVisible(true)
    world:add(ball_5)

    ------------------
    ball_6 = luajava.new(Ball)
    ball_6:setPosition(224.0, 237.0)
    ball_6:setRotation(0.0)
    ball_6:setName('ball_6')
    ball_6:setVisible(true)
    ball_6:setBodyBox(15, 15)
    ball_6:setSpriteBox(30, 30)
    ball_6:setDensity(2)
    world:add(ball_6)

    ------------------
    ball_7 = luajava.new(Ball)
    ball_7:setPosition(170.0, 261.0)
    ball_7:setRotation(0.0)
    ball_7:setName('ball_7')
    ball_7:setVisible(true)
    world:add(ball_7)

    ------------------
    ball_8 = luajava.new(Ball)
    ball_8:setPosition(203.99997, 242.0)
    ball_8:setRotation(0.0)
    ball_8:setName('ball_8')
    ball_8:setVisible(true)
    world:add(ball_8)

    local cloud = luajava.new(Cloud)
    cloud:setPosition(luajava.new(Vector2, 100, 420))
    world:add(cloud)
    cloud:setMinMaxPosRectangle(100, 300, 600, 200)
end

time = 0
moved = false
function onCheck()
    if Ground_2:getRotation() > -10 and Ground_2:getRotation() < 15 then
        if time == 0 then
            time = world:getTime()
        end
    else
        time = 0
    end

    if moved == false and time ~= 0 and world:getTime() - time > 5 then
        Ground_4:setPosition(-1000, -1000)
        moved = true
    end

    return trigger_3:getState()
end
